const products = [
  { name: '苹果', price: 5, id: 1, inventory: 10 },
  { name: '香蕉', price: 10, id: 2, inventory: 12 },
  { name: '橘子', price: 12, id: 3, inventory: 8 }
]
/**  注意这个地方是模拟接口请求,实际上肯定是请求后端的api,
  这里因为要用到action所以
  封装一个异步请求模拟一下
  **/
// 得到商品列表
export const getProducts = () => {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve(products)
    }, 50)
  })
}
